#ifndef DISPLAY_CLASS_H
#define DISPLAY_CLASS_H

#include <string>
#include <vector>
#include <allegro5/allegro.h>
#include <allegro5/allegro_color.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
#include <allegro5\allegro_native_dialog.h>
#include "colour.h"
#include "GlobalVariables.h"
#include "Point.h"
#include "Utilities.h"

#include "Movables.h"
#include "Monster.h"
#include "Digdug.h"
#include "Projectile.h"


using std::string;

class Display
{
public:
	Display();
	~Display();
	
	// update the display
	void update();			//!<Draws elemets & updates display
	void clearBuffer();		//!Resets the back buffer
	void startTimer();		//!Starts the event que timer

	//Allow access to the event queue
	ALLEGRO_EVENT_QUEUE* event_queue();	//!Returns the event stack

	//Bitmap Draw Routines
	void drawAsGrid(vector <vector <Movable_type>> map) const; 
	void drawMap(Map map) const;

	void drawBoxesToScreen();

	void drawMonsters( vector <Monster> &monsters) const;
	void drawDigdug( Digdug &digdug) const;
	void drawProjectile(Projectile &projectile, Digdug &digdug) const;
	
	void drawMessage(string message, string colour);
	void drawScoreBox(int score, int lives, int high_score, int level);
	int showNativeDialogMessage(char const *title, char const *text);
	

private:
	
	void initialiseAllegroComponents() const;
	void allocateAllegroResources();

	int _display_width;
	int _display_height;
	void drawScaledBitmap(Point location, int radius,int scale,  ALLEGRO_BITMAP *bitmap) const;
	
	void drawGameBox();

	// pointers to Allegro resources
	ALLEGRO_DISPLAY* _display;
	ALLEGRO_EVENT_QUEUE* _event_queue;
	ALLEGRO_TIMER *_timer;
	ALLEGRO_FONT* _font32;
	ALLEGRO_FONT* _font24;
	ALLEGRO_FONT* _font60;

	ALLEGRO_BITMAP* _game_box;
	ALLEGRO_BITMAP* _score_box;

};

#endif